home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1468 / demo.frm (.txt) < prev    next >
Visual Basic Form  |  1996-07-19  |  12KB  |  377 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDemo 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "VBMax Liquid Crystal Display Demo"
  5.    ClientHeight    =   3270
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   6375
  9.    Height          =   3675
  10.    Icon            =   "Demo.frx":0000
  11.    Left            =   0
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   218
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   425
  18.    Top             =   0
  19.    Width           =   6495
  20.    Begin VB.PictureBox picDate 
  21.       Height          =   210
  22.       Left            =   570
  23.       ScaleHeight     =   150
  24.       ScaleWidth      =   915
  25.       TabIndex        =   26
  26.       Top             =   3000
  27.       Width           =   975
  28.    End
  29.    Begin VB.PictureBox picTime 
  30.       Height          =   210
  31.       Left            =   2460
  32.       ScaleHeight     =   150
  33.       ScaleWidth      =   795
  34.       TabIndex        =   25
  35.       Top             =   3000
  36.       Width           =   855
  37.    End
  38.    Begin VB.Timer Timer1 
  39.       Interval        =   500
  40.       Left            =   5520
  41.       Top             =   540
  42.    End
  43.    Begin VB.CommandButton cmdName 
  44.       Caption         =   "E&xit"
  45.       Height          =   315
  46.       Index           =   9
  47.       Left            =   4920
  48.       TabIndex        =   24
  49.       Top             =   2880
  50.       Width           =   1215
  51.    End
  52.    Begin VB.CommandButton cmdName 
  53.       Cancel          =   -1  'True
  54.       Caption         =   "&About"
  55.       Height          =   315
  56.       Index           =   8
  57.       Left            =   3600
  58.       TabIndex        =   23
  59.       Top             =   2880
  60.       Width           =   1215
  61.    End
  62.    Begin VB.Frame Frame5 
  63.       Caption         =   "More Examples"
  64.       Height          =   1815
  65.       Left            =   3480
  66.       TabIndex        =   14
  67.       Top             =   900
  68.       Width           =   2775
  69.       Begin VB.CommandButton cmdName 
  70.          Caption         =   "Alarm"
  71.          Height          =   315
  72.          Index           =   4
  73.          Left            =   120
  74.          TabIndex        =   21
  75.          Top             =   1380
  76.          Width           =   1215
  77.       End
  78.       Begin VB.CommandButton cmdName 
  79.          Caption         =   "Calculator"
  80.          Height          =   315
  81.          Index           =   0
  82.          Left            =   120
  83.          TabIndex        =   15
  84.          Top             =   300
  85.          Width           =   1215
  86.       End
  87.       Begin VB.CommandButton cmdName 
  88.          Caption         =   "Countdown"
  89.          Height          =   315
  90.          Index           =   1
  91.          Left            =   120
  92.          TabIndex        =   17
  93.          Top             =   660
  94.          Width           =   1215
  95.       End
  96.       Begin VB.CommandButton cmdName 
  97.          Caption         =   "Stopwatch"
  98.          Height          =   315
  99.          Index           =   2
  100.          Left            =   120
  101.          TabIndex        =   19
  102.          Top             =   1020
  103.          Width           =   1215
  104.       End
  105.       Begin VB.CommandButton cmdName 
  106.          Caption         =   "24 Hour Clock"
  107.          Height          =   315
  108.          Index           =   3
  109.          Left            =   1440
  110.          TabIndex        =   18
  111.          Top             =   660
  112.          Width           =   1215
  113.       End
  114.       Begin VB.CommandButton cmdName 
  115.          Caption         =   "Dialer"
  116.          Height          =   315
  117.          Index           =   5
  118.          Left            =   1440
  119.          TabIndex        =   20
  120.          Top             =   1020
  121.          Width           =   1215
  122.       End
  123.       Begin VB.CommandButton cmdName 
  124.          Caption         =   "12 Hour Clock"
  125.          Height          =   315
  126.          Index           =   6
  127.          Left            =   1440
  128.          TabIndex        =   16
  129.          Top             =   300
  130.          Width           =   1215
  131.       End
  132.       Begin VB.CommandButton cmdName 
  133.          Caption         =   "LCD Array"
  134.          Height          =   315
  135.          Index           =   7
  136.          Left            =   1440
  137.          TabIndex        =   22
  138.          Top             =   1380
  139.          Width           =   1215
  140.       End
  141.    End
  142.    Begin VB.Frame Frame1 
  143.       Caption         =   "LCD Attributes"
  144.       Height          =   1995
  145.       Left            =   120
  146.       TabIndex        =   1
  147.       Top             =   900
  148.       Width           =   3195
  149.       Begin VB.Frame Frame4 
  150.          Caption         =   "Colors"
  151.          Height          =   1260
  152.          Left            =   1920
  153.          TabIndex        =   10
  154.          Top             =   240
  155.          Width           =   1155
  156.          Begin VB.CommandButton Command7 
  157.             Caption         =   "BackColor"
  158.             Height          =   315
  159.             Left            =   90
  160.             TabIndex        =   12
  161.             Top             =   780
  162.             Width           =   975
  163.          End
  164.          Begin VB.CommandButton Command6 
  165.             Caption         =   "ForeColor"
  166.             Height          =   315
  167.             Left            =   90
  168.             TabIndex        =   11
  169.             Top             =   360
  170.             Width           =   975
  171.          End
  172.       End
  173.       Begin VB.Frame Frame2 
  174.          Caption         =   "Size"
  175.          Height          =   1260
  176.          Left            =   120
  177.          TabIndex        =   2
  178.          Top             =   240
  179.          Width           =   615
  180.          Begin VB.VScrollBar VScroll1 
  181.             Height          =   795
  182.             Left            =   300
  183.             Max             =   15
  184.             Min             =   -15
  185.             TabIndex        =   5
  186.             Top             =   300
  187.             Width           =   195
  188.          End
  189.          Begin VB.Label Label1 
  190.             AutoSize        =   -1  'True
  191.             BackStyle       =   0  'Transparent
  192.             Caption         =   "-"
  193.             BeginProperty Font 
  194.                name            =   "MS Sans Serif"
  195.                charset         =   0
  196.                weight          =   700
  197.                size            =   12
  198.                underline       =   0   'False
  199.                italic          =   0   'False
  200.                strikethrough   =   0   'False
  201.             EndProperty
  202.             Height          =   300
  203.             Left            =   90
  204.             TabIndex        =   3
  205.             Top             =   270
  206.             Width           =   105
  207.          End
  208.          Begin VB.Label Label2 
  209.             AutoSize        =   -1  'True
  210.             BackStyle       =   0  'Transparent
  211.             Caption         =   "+"
  212.             BeginProperty Font 
  213.                name            =   "MS Sans Serif"
  214.                charset         =   0
  215.                weight          =   700
  216.                size            =   12
  217.                underline       =   0   'False
  218.                italic          =   0   'False
  219.                strikethrough   =   0   'False
  220.             EndProperty
  221.             Height          =   300
  222.             Left            =   90
  223.             TabIndex        =   4
  224.             Top             =   840
  225.             Width           =   165
  226.          End
  227.       End
  228.       Begin VB.CheckBox Check1 
  229.          Caption         =   "Show unlit segments"
  230.          Height          =   300
  231.          Left            =   180
  232.          TabIndex        =   13
  233.          Top             =   1620
  234.          Value           =   1  'Checked
  235.          Width           =   1875
  236.       End
  237.       Begin VB.Frame Frame3 
  238.          Caption         =   "Alignment"
  239.          Height          =   1260
  240.          Left            =   840
  241.          TabIndex        =   6
  242.          Top             =   240
  243.          Width           =   975
  244.          Begin VB.OptionButton optAlign 
  245.             Caption         =   "Left"
  246.             Height          =   255
  247.             Index           =   0
  248.             Left            =   90
  249.             TabIndex        =   7
  250.             Top             =   300
  251.             Width           =   855
  252.          End
  253.          Begin VB.OptionButton optAlign 
  254.             Caption         =   "Right"
  255.             Height          =   255
  256.             Index           =   1
  257.             Left            =   90
  258.             TabIndex        =   8
  259.             Top             =   600
  260.             Value           =   -1  'True
  261.             Width           =   855
  262.          End
  263.          Begin VB.OptionButton optAlign 
  264.             Caption         =   "Center"
  265.             Height          =   255
  266.             Index           =   2
  267.             Left            =   90
  268.             TabIndex        =   9
  269.             Top             =   900
  270.             Width           =   855
  271.          End
  272.       End
  273.    End
  274.    Begin VB.PictureBox picLCD 
  275.       Height          =   435
  276.       Left            =   120
  277.       ScaleHeight     =   375
  278.       ScaleWidth      =   6075
  279.       TabIndex        =   0
  280.       Top             =   120
  281.       Width           =   6135
  282.    End
  283.    Begin VB.Label Label4 
  284.       AutoSize        =   -1  'True
  285.       Caption         =   "Time:"
  286.       Height          =   195
  287.       Left            =   1980
  288.       TabIndex        =   28
  289.       Top             =   3000
  290.       Width           =   390
  291.    End
  292.    Begin VB.Label Label3 
  293.       AutoSize        =   -1  'True
  294.       Caption         =   "Date:"
  295.       Height          =   195
  296.       Left            =   120
  297.       TabIndex        =   27
  298.       Top             =   3000
  299.       Width           =   390
  300.    End
  301. Attribute VB_Name = "frmDemo"
  302. Attribute VB_Creatable = False
  303. Attribute VB_Exposed = False
  304. Option Explicit
  305. Dim moLCD        As New CLCD
  306. Dim moTime       As New CLCD
  307. Dim moDate       As New CLCD
  308. Dim mnOrigHeight As Integer
  309. Private Sub Form_Load()
  310.     Move 0, 0
  311.     With moDate
  312.         .Alignment = gnCENTER
  313.         .ForeColor = vbGreen
  314.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  315.         Set .Container = picDate
  316.         .Caption = Format$(Now, "mm-dd-yy")
  317.     End With
  318.     With moTime
  319.         .BlinkColon = True
  320.         .Alignment = gnCENTER
  321.         .ForeColor = vbGreen
  322.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  323.         Set .Container = picTime
  324.     End With
  325.     With moLCD
  326.         .ShowUnlitSegments = True
  327.         .AutoSize = gnAUTOSIZE_LCD_TO_CONTAINER
  328.         Set .Container = picLCD
  329.         .Caption = "-123,456,789.012"
  330.     End With
  331.     mnOrigHeight = picLCD.Height
  332. End Sub
  333. Private Sub Form_Unload(Cancel As Integer)
  334.     Set moDate = Nothing
  335.     Set moTime = Nothing
  336.     Set moLCD = Nothing
  337.     Set frmDemo = Nothing
  338.     End
  339. End Sub
  340. Private Sub cmdName_Click(Index As Integer)
  341.     Select Case Index
  342.         Case 0: Calculator.Show
  343.         Case 1: CountDown.Show
  344.         Case 2: Stopwatch.Show
  345.         Case 3: Clock24.Show
  346.         Case 4: AlarmForm.Show
  347.         Case 5: Dialer.Show
  348.         Case 6: Clock12.Show
  349.         Case 7: LCDArray.Show
  350.         Case 8: moLCD.About
  351.         Case 9: Unload Me
  352.     End Select
  353. End Sub
  354. Private Sub Command6_Click()
  355.     moLCD.SelectForeColor
  356. End Sub
  357. Private Sub Command7_Click()
  358.     moLCD.SelectBackColor
  359. End Sub
  360. Private Sub optAlign_Click(Index As Integer)
  361.     Select Case Index
  362.         Case 0: moLCD.Alignment = gnALIGN_LEFT
  363.         Case 1: moLCD.Alignment = gnALIGN_RIGHT
  364.         Case 2: moLCD.Alignment = gnCENTER
  365.     End Select
  366. End Sub
  367. Private Sub VScroll1_Change()
  368.     picLCD.Height = mnOrigHeight + VScroll1.Value
  369.     moLCD.Redisplay
  370. End Sub
  371. Private Sub Check1_Click()
  372.     moLCD.ShowUnlitSegments = Not moLCD.ShowUnlitSegments
  373. End Sub
  374. Private Sub Timer1_Timer()
  375.     moTime.Caption = Format$(Now, "h:mm A/P")
  376. End Sub
  377.